1. Technical Field
The invention relates to a position detection device for a robot, a robotic system, and a position detection method for a robot, each for detecting a position of the robot or a work the robot conveys based on an image.
2. Related Art
As described in, for example, JP-A-2009-2860, there has been known a method of detecting the position of an end effector provided to a robot and the position of a work gripped by the end effector of the robot based on an image. FIG. 5 shows an example of applying the method described above to position detection of a robot and position detection of a work performed in the middle of the operation of conveying the work.
As shown in FIG. 5, a horizontal articulated robot 40 (hereinafter referred to as a robot 40) incorporates a first electric motor 41a for rotating a first arm 42 coupled to a base 41 and a second electric motor 43a for rotating a second arm 43 coupled to the first arm 42. The first arm 42 and the second arm 43 constituting the robot 40 move to the positions corresponding to the respective drive amounts of the first electric motor 41a and the second electric motor 43a. Thus, the robot 40 grips a work W mounted on a mounting stage 51 with an end effector 45 coupled to the tip of a spline 44 at a grip position P1, and then conveys the work W from the grip position P1 to an imaging position P2 directly above a camera 52.
In a robot controller 60, there are installed a control section 61 for interpreting and then executing an action program stored in the robot controller 60, and a motor driver 62 for outputting drive signals to respective drive sources based on a control signal output by the control section 61. Further, in the robot controller 60, there is installed an image processing section 63 for calculating the position of one of the end effector 45 and the work W from the image taken by the camera 52. Further, in the robot controller 60, there is installed a storage section 64 for storing a variety of data required for the control of the robot 40, and the storage section 64 stores position data 64a representing the coordinate of the grip position P1 and the coordinate of the imaging position P2.
Further, when detecting the position of the work W with respect to the end effector 45, the control section 61 firstly interprets the action program for detecting the grip condition of the work W, and then calculates the drive amounts of the respective drive sources for moving the end effector 45 from the current position to the grip position P1. Subsequently, the drive signals based on the calculation result of the control section 61 are output from the motor 62 to the first electric motor 41a and the second electric motor 43a. Thus, the end effector 45 moves to the grip position P1 and then grips the work W.
Subsequently, the control section 61 calculates the drive amounts of the respective drive sources for moving the end effector 45 from the grip position P1 to the imaging position P2, and the motor driver 62 outputs the drive signals based on the calculation result of the control section 61 to the first electric motor 41a and the second electric motor 43a. Thus, the end effector 45 moves to the imaging position P2 while gripping the work W.
Then, when determining that the end effector 45 reaches the imaging position P2 based on output signals output by an encoder of the first electric motor 41a and an encoder of the second electric motor 43a, the control section 61 outputs the control signal for driving the camera 52. Thus, when the camera 52 images the work W gripped by the end effector 45, and the control section 61 outputs a signal for obtaining the image, the image taken by the camera 52 is input to the image processing section 63. Then, the image processing section 63 calculates the position of the work W from the image, and at the same time, the control section 61 calculates the position of the work W with respect to the end effector 45 based on the result of the calculation and the coordinate of the imaging position P2.
Incidentally, in the method described above, the movement of the end effector 45 is stopped at the imaging position P2 when imaging the work W while it is being gripped by the end effector 45. Further, the actual position of the end effector 45 is treated as the imaging position P2 set in advance.
However, in such a method, the movement of the robot 40 is stopped every time the action for detecting the gripping condition of the work W is performed, and if such a gripping condition is detected in the process of conveying the work W, the conveying efficiency of the work W is spontaneously degraded. Incidentally, besides the action for detecting the gripping condition of the work W, in the case of detecting the position of the end effector 45 in the process of other actions, the efficiency of the primary process the robot 40 should perform is similarly degraded after all as long as the movement of the end effector 45 is stopped at the imaging position P2. In other words, in the method described above, the process of making the condition of the robot calculated from the taken image correspond to the drive amounts of the respective drive sources degrades the efficiency of the other processes.